import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 设备信息
 */
@Entity('device_device')
export class DeviceDeviceEntity extends BaseEntity {
  // @Column({ comment: '设备名称', nullable: true })
  // deviceName: string;

  @Index({ unique: true })
  @Column({ comment: '设备编号' })
  deviceNo: string;

  // @Column({ comment: '设备类型', dict: ['物联网设备', '收款设备'], default: 0 })
  // deviceType: number;

  @Column({ comment: '设备状态', dict: ['未激活', '在线', '离线'], default: 0 })
  deviceStatus: number;

  // @Column({ comment: '绑定时间', nullable: true })
  // bindTime: Date;

  @Column({ comment: '最后在线时间', nullable: true })
  lastOnlineTime: number;

  @Column({ comment: '设备归属商家ID', nullable: true })
  userId: number;

  // 设备归属代理
  @Column({ comment: '设备归属代理ID', nullable: true })
  agentId: number;
}
